<#import "include/simple-one.fun.ftl" as simple>  
<#include "header.ftl" />
	<div class="main-content">
		<div class="main-posts">
			<@ad id=1 />
			<#if (postPage?exists && postPage.result?size > 0)>
				<#list postPage.result as post>
					<div class="post-item">
				        <h2 class="post-title">
				            <a href="<@postUrl id=post.id />" title="${post.title}">${post.title}</a>
				            <#if post.isTop><sup class="tip">置顶！</sup></#if>
				        </h2>
				        <div class="post-summary">
				        	<#if post.password?has_content>
				        		该文章需要密码访问！
				        	<#else>
				        		<#if post.summary?has_content>
				        			<@contentTransform content=post.summary />
				        		<#else>
				        			<@contentTransform content=post.content removeHtml=true substring=true endIndex=600 />
				        		</#if>
				        		<p class="post-img" style="margin: 0 0 10px 0;">
				        			<@postImg post=post.id width=800 height=500 />
					        		<#if postImgUrl?has_content>
					        			<a title="${post.title}" href="<@postUrl id=post.id />"><img src="${postImgUrl}" alt="${post.title}"/></a>
					        		</#if>
				        		</p>
				        	</#if>
				        </div>
				        <div class="post-ft">
				           	分类：
				           	<#list post.catalogs as catalog><a href="${base}/post/catalog-${catalog.id}.html" rel="tag">${catalog.name}</a>&nbsp;&nbsp;</#list>
							标签：
							<#list post.tags as tag><a href="${base}/post/tag-${tag.id}.html" rel="tag">${tag.name}</a>&nbsp;&nbsp;</#list>
							于${post.createTime}发表该文章<span class="split">|</span>${post.views} views           
				           	<p class="btn-wrap">
				               <a class="btn" href="<@postUrl id=post.id />">More</a>
				           </p>
				        </div>
				    </div>
				</#list>
				<#if (postPage.totalPages > 1)>
					<@simple.pagenavi />
				</#if>
			<#else>
				暂无文章
			</#if>
		</div>
	</div>
<#include "footer.ftl" />